import { defineStore } from "pinia";
import { Theme } from "@/stores/interface";
import piniaPersistConfig from "@/stores/helper/persist";

export const useThemeStore = defineStore({
  id: "theme",
  state: (): Theme => ({
    theme: "blue-theme"
  }),
  actions: {
    // 设置主题
    setTheme(theme: string) {
      this.theme = theme;
    }
  },
  persist: piniaPersistConfig("theme")
});
